﻿using Autofac;
using Autofac.Integration.Mvc;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Mvc;
using System.Windows.Forms;

namespace ZK.YHP_TransManage
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            //判断是否已经有需要运行一个实例，如果系统没有，则运行一个
            bool noRun;
            using (System.Threading.Mutex m = new System.Threading.Mutex(true, Application.ProductName, out noRun))
            {
                if (noRun)
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);

                    if (Common.AppConfigHelper.GetAppSettings("Debug") == "false")
                    {
                        Application.Run(new Login());//主要入口
                    }
                    else
                    {
                        //Application.Run(new Index());//主要入口
                        Application.Run(new Login());//主要入口
                    }
                    //ShiWaiDuKaQi
                    //Application.Run(new TestIndex());
                    //Application.Run(new Test.接口测试());
                    //Application.Run(new Test.ShiWaiDuKaQi());
                    //Application.Run(new Test.OnbonLed());
                    //Application.Run(new UserControlLibrary.HardWare());
                    //Application.Run(new Test.LogTest());
                    //Application.Run(new Index());
                    ///Application.Run(new UserControlLibrary.Print(new Common.ProModels.TruckYxInfo())) ;
                    // Application.Run(new Test.testwinform());
                    //  Application.Run(new Test.Camera());//确认32位dll可以执行。
                }
                else
                {
                    MessageBox.Show("目前已有一个程序在运行，请勿重复运行程序", "提示");
                }
            }
        }





    }
}
